package com.flower.utils;

import com.flower.domain.entity.User;

import java.util.List;

public class ThreadUtils {

    private static final ThreadLocal<Object> testThreadLocal = new ThreadLocal();
    /**
     * 存储&绑定
     * @param object
     */
    public static void bind(Object object) {
        testThreadLocal.set(object);
    }

    /**
     * 获取绑定数据
     * @return
     */
    public static Object get() {
        return testThreadLocal.get();
    }

    /**
     * 删除
     */
    public static void remove() {
        testThreadLocal.remove();
    }

    public static void main(String[] args) {
        bind("不如喜羊羊哥哥");
        System.out.println(get().toString());
    }
}
